var contentPath = $("#topNavCon").attr("value");

$(function(){
	getIndexList();
});


function getIndexList(){

	$.ajax({  
        url:"getIndexList.do",  
        type:"POST",  
        data:{
        	
        },
        success:function(data){
        	data=eval("("+data+")"); 
        	var headList=data.headList;
			if(headList.length > 0 ){
				var html = "";
				for(var i=0; i<headList.length; i++){
					html += '<a class="index-banner-list swiper-slide" style="background-image: url('+headList[i].picUrl+')" href="'+headList[i].link+'">';
					html += '<div class="index-banner-mask"></div>';
					html += '<div class="intro-container">';
					html += '<div class="linear-line"></div>';
					html += '<div class="title-contain">';
					html += '<h3>'+headList[i].title+'</h3>';
					html += '</div>';
					html += '<div class="intro-contain">';
					html += '<p>'+headList[i].mark+'</p>';
					html += '</div></div></a>';
				}
				$("#headListBody").html(html);
			}
			
			var titleList = data.titleList;
			var homeArticleList = data.homeArticle;
			if(titleList.length > 0 ){
				var html = "";
				for(var i=0; i<titleList.length; i++){
					html += '<div class="case-list-contain">';
					html += '<h4 class="list-title">'+titleList[i].title+'</h4>';
					html += '<div class="list-scr-contain">';
					html += '<div class="list-scr-content">';
					for(var j=0; j<homeArticleList.length; j++){
						if(homeArticleList[j].hometitleId == titleList[i].hometitleId){
							html += '<a class="case-list" href="'+homeArticleList[j].url+'" target="_blank">';
							html += '<div class="img-contain">';
							html += '<div class="mask-contain"></div>';
							html += '<img src="'+homeArticleList[j].picUrl+'" alt=""/>';
							html += '</div>';
							html += '<div class="info-contain">';
							html += '<p><i class="icon"></i><span class="title">'+homeArticleList[j].title+'</span></p>';
							html += '</div>';
							html += '</a>'
						}
					}
					html += '</div></div></div>';
				}
				$("#case_listBody").html(html);
			}
			indexSwipe();
			indexInfoHide();
        },   
	});
}